<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
	window.onload = function () {
		var oDiv = document.getElementById('div1');
		var oBtn = document.getElementById('btn');
		var oP = document.getElementById('p1');
	
		oBtn.onclick = function() {
			/*
				父级.replaceChild(新节点，被替换的节点)		替换子节点
			*/
			// document.body.replaceChild( oDiv, oP )
		}

	}
	</script>
</head>
<body>
	<div id="div1">div1</div>
    <input type="button" value="按钮" id="btn" />
    <hr />
    <p id="p1">ppppp</p>
</body>
</html>